package org.project.d.starter.network;

import lombok.extern.slf4j.Slf4j;
import org.project.d.network.msg.Message;
import org.project.d.network.msg.Transmission;
import org.project.d.network.msg.serializer.NoSerialization;
import org.project.d.starter.network.annotation.HandlerMapping;
import org.project.d.starter.network.annotation.MsgHandler;

/**
 * @author lin
 * @version V1.0
 * @description
 * @date 2020/8/3 4:57 下午
 */
@Slf4j
@MsgHandler
public class NetworkHandler {
    @HandlerMapping(value = 1,deSerializa = NoSerialization.class)
    public void test(Message message){
      log.info("test1 "+message.toString());
    }
    @HandlerMapping(value = 2)
    public Transmission test2(Message message){
        log.info("test2 "+message.toString());
        return Transmission.builder().commandCode(()-> (short) 2).message(22).build();
    }


}
